ostbuild: git-mirror: Also fetch patches git
authorColin Walters <walters@verbum.org>
Thu, 24 May 2012 22:11:06 +0000 (18:11 -0400)
committerColin Walters <walters@verbum.org>
Thu, 24 May 2012 22:11:06 +0000 (18:11 -0400)
src/ostbuild/pyostbuild/builtin_git_mirror.py
src/ostbuild/pyostbuild/builtins.py

index 34e239466127be5a7de6a34b8d583bdf8e9522e4..9c64d4113b605f61bcdd7201073cd03fc828c570 100755 (executable)
@@ -52,6 +52,8 @@ class OstbuildGitMirror(builtins.Builtin):
             components = []
             for component in self.snapshot['components']:
                 components.append(component['name'])
+            if 'patches' in self.snapshot:
+                components.append(self.snapshot['patches']['name'])
             if args.start_at:
                 idx = components.index(args.start_at)
                 components = components[idx:]
index 4bcc7337b3b911d474b87d62453a3d1f3c519851..b5fd10430e3e578fdb8ab0710a9f70de688aadee 100755 (executable)
@@ -135,6 +135,10 @@ class Builtin(object):
         else:
             target_snapshot = in_snapshot
         component = self.find_component_in_snapshot(name, target_snapshot)
+        if (component is None and 
+            'patches' in self.snapshot and
+            self.snapshot['patches']['name'] == name):
+            return self.snapshot['patches']
         if component is None:
             fatal("Couldn't find component '%s' in manifest" % (name, ))
         return component